package com.ruiyi.adrobot.beans;/**
 * Created by tao.zeng on 2017/6/8.
 */

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

/**
 * 业务类型
 *
 * @author
 * @create 2017-06-08 9:27
 **/
public class Fun {
    private String id;
    private Integer fun; // 功能
    private String describe; // 描述
    private String remark; // 备注
    private List<Flow> flows; // 流程
    private String createDate;

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Document
    public static class Flow {
        @Id
        private String id;
        private String describe; // 流程描述
        private Action action; // 动作

        public Flow() {
        }

        public static class Action {
            private String pkgName; // 包名
            private String url; // apk 下载地址
            private String md5; // md5校验码
            private List<Step> steps; // 动作包含的步骤

            public String getMd5() {
                return md5;
            }

            public void setMd5(String md5) {
                this.md5 = md5;
            }

            public String getUrl() {
                return url;
            }

            public void setUrl(String url) {
                this.url = url;
            }

            public List<Step> getSteps() {
                return steps;
            }

            public void setSteps(List<Step> steps) {
                this.steps = steps;
            }

            public static class Step {
                private Integer stepType; // // 1:点击 2：滑动 3:账号 4：密码  5:自动申请账号 6：动态密码 7：短信验证码 8：获取图形验证码 9: 填写图形验证码 10:打开浏览器 11：关闭浏览器
                private String url; // 打开浏览器url
                private Boolean virtual; // 是否使用虚拟字段
                private Integer stepX; //X坐标
                private Integer stepY;//Y坐标
                private String viewType; //控件l类型
                private String viewID;//控件ID
                private String placeholder; // placeholder 内容
                private String btnText; // 按钮名
                private String viewText;//控件显示文本
                private SleepTime sleepTime; //停留时间段
                private InterfaceInfo interfaceInfo; // 第三方接口信息

                public Boolean getVirtual() {
                    return virtual;
                }

                public void setVirtual(Boolean virtual) {
                    this.virtual = virtual;
                }

                public static class InterfaceInfo {
                    private String userName; // 用户名
                    private String pwd; // 密码
                    private String projectId; // 项目Id

                    public String getUserName() {
                        return userName;
                    }

                    public void setUserName(String userName) {
                        this.userName = userName;
                    }

                    public String getPwd() {
                        return pwd;
                    }

                    public void setPwd(String pwd) {
                        this.pwd = pwd;
                    }

                    public String getProjectId() {
                        return projectId;
                    }

                    public void setProjectId(String projectId) {
                        this.projectId = projectId;
                    }
                }

                public String getUrl() {
                    return url;
                }

                public void setUrl(String url) {
                    this.url = url;
                }

                public InterfaceInfo getInterfaceInfo() {
                    return interfaceInfo;
                }

                public void setInterfaceInfo(InterfaceInfo interfaceInfo) {
                    this.interfaceInfo = interfaceInfo;
                }

                public String getPlaceholder() {
                    return placeholder;
                }

                public void setPlaceholder(String placeholder) {
                    this.placeholder = placeholder;
                }

                public String getBtnText() {
                    return btnText;
                }

                public void setBtnText(String btnText) {
                    this.btnText = btnText;
                }

                class SleepTime {
                    private Integer min; // 最短
                    private Integer max; // 最长

                    public Integer getMin() {
                        return min;
                    }

                    public void setMin(Integer min) {
                        this.min = min;
                    }

                    public Integer getMax() {
                        return max;
                    }

                    public void setMax(Integer max) {
                        this.max = max;
                    }
                }

                public Integer getStepType() {
                    return stepType;
                }

                public void setStepType(Integer stepType) {
                    this.stepType = stepType;
                }

                public Integer getStepX() {
                    return stepX;
                }

                public void setStepX(Integer stepX) {
                    this.stepX = stepX;
                }

                public Integer getStepY() {
                    return stepY;
                }

                public void setStepY(Integer stepY) {
                    this.stepY = stepY;
                }

                public String getViewType() {
                    return viewType;
                }

                public void setViewType(String viewType) {
                    this.viewType = viewType;
                }

                public String getViewID() {
                    return viewID;
                }

                public void setViewID(String viewID) {
                    this.viewID = viewID;
                }

                public String getViewText() {
                    return viewText;
                }

                public void setViewText(String viewText) {
                    this.viewText = viewText;
                }

                public SleepTime getSleepTime() {
                    return sleepTime;
                }

                public void setSleepTime(SleepTime sleepTime) {
                    this.sleepTime = sleepTime;
                }
            }

            public String getPkgName() {
                return pkgName;
            }

            public void setPkgName(String pkgName) {
                this.pkgName = pkgName;
            }
        }

        public Action getAction() {
            return action;
        }

        public void setAction(Action action) {
            this.action = action;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getDescribe() {
            return describe;
        }

        public void setDescribe(String describe) {
            this.describe = describe;
        }
    }

    public List<Flow> getFlows() {
        return flows;
    }

    public void setFlows(List<Flow> flows) {
        this.flows = flows;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public Integer getFun() {
        return fun;
    }

    public void setFun(Integer fun) {
        this.fun = fun;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }


}
